package demo;

import org.apache.commons.lang.math.NumberUtils;
import org.apache.hadoop.hive.ql.exec.UDF;

public class JiaMi extends UDF {
    public String evaluate(String s1) {
        // hive中手机号加密
        if (s1.length() == 11 && NumberUtils.isNumber(s1)){
            String head = s1.substring(0,3);
            String tail = s1.substring(7);
            return head + "****" + tail;
        }
        return s1;
    }
}
